<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Hello Trae</title>
    <style>
        /* 全局样式重置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        /* 基础样式 */
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
                'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
                sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: #333;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        /* 容器样式 */
        .container {
            background: white;
            border-radius: 20px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            padding: 40px;
            text-align: center;
            max-width: 500px;
            width: 100%;
            transform: translateY(0);
            animation: float 6s ease-in-out infinite;
        }

        /* 标题样式 */
        h1 {
            font-size: 3rem;
            margin-bottom: 20px;
            background: linear-gradient(45deg, #667eea, #764ba2);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            display: inline-block;
        }

        /* 段落样式 */
        p {
            font-size: 1.2rem;
            margin-bottom: 30px;
            color: #666;
            line-height: 1.6;
        }

        /* 按钮样式 */
        #greetBtn {
            background: linear-gradient(45deg, #667eea, #764ba2);
            color: white;
            border: none;
            border-radius: 50px;
            padding: 15px 30px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        #greetBtn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
        }

        #greetBtn:active {
            transform: translateY(0);
        }

        /* 动画效果 */
        @keyframes float {
            0% {
                transform: translateY(0px);
            }
            50% {
                transform: translateY(-10px);
            }
            100% {
                transform: translateY(0px);
            }
        }
        
        @keyframes pulse {
            0% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.05);
            }
            100% {
                transform: scale(1);
            }
        }
        
        .pulse {
            animation: pulse 0.5s ease-in-out;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .container {
                padding: 30px 20px;
            }

            h1 {
                font-size: 2.5rem;
            }

            p {
                font-size: 1.1rem;
            }
        }

        @media (max-width: 480px) {
            h1 {
                font-size: 2rem;
            }

            #greetBtn {
                padding: 12px 25px;
                font-size: 0.9rem;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Hello Trae</h1>
        <p>欢迎使用Trae AI编程助手！</p>
        <button id="greetBtn">点击问候</button>
    </div>
    <script>
        // 获取DOM元素
        const greetBtn = document.getElementById('greetBtn');
        const container = document.querySelector('.container');
        const heading = document.querySelector('h1');
        const paragraph = document.querySelector('p');

        // 问候语数组
        const greetings = [
            '你好，Trae！',
            'Hello, Trae!',
            'Hola, Trae!',
            'Bonjour, Trae!',
            'Ciao, Trae!',
            'こんにちは、Trae！',
            '안녕하세요, Trae！'
        ];

        // 按钮点击事件
        greetBtn.addEventListener('click', () => {
            // 随机选择一个问候语
            const randomGreeting = greetings[Math.floor(Math.random() * greetings.length)];
            
            // 更新标题
            heading.textContent = randomGreeting;
            
            // 添加点击动画效果
            container.style.animation = 'none';
            container.offsetHeight; // 触发重绘
            container.style.animation = 'float 6s ease-in-out infinite';
            
            // 添加脉冲效果
            container.classList.add('pulse');
            setTimeout(() => {
                container.classList.remove('pulse');
            }, 500);
            
            // 更新按钮文本并改变样式
            greetBtn.textContent = '再来一次！';
            greetBtn.style.background = 'linear-gradient(45deg, #f093fb, #f5576c)';
            
            // 随机背景颜色变化
            const colors = [
                'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
                'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)',
                'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
                'linear-gradient(135deg, #fa709a 0%, #fee140 100%)',
                'linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)'
            ];
            
            const randomColor = colors[Math.floor(Math.random() * colors.length)];
            document.body.style.background = randomColor;
            document.body.style.transition = 'background 1s ease';
        });

        // 添加页面加载动画
        window.addEventListener('load', () => {
            container.style.opacity = '0';
            container.style.transform = 'translateY(20px)';
            
            setTimeout(() => {
                container.style.opacity = '1';
                container.style.transform = 'translateY(0)';
                container.style.transition = 'opacity 0.8s ease, transform 0.8s ease';
            }, 100);
        });
    </script>
</body>
</html>